To provide a component, you define a component function and supply the appropriate registration information. You store your component function in a code resource and typically store your component's registration information as resources in a component file. For additional information on this process, see "Creating Components," .
Here's how to declare a component function named MyComponent :
FUNCTION MyComponent (params: ComponentParameters;
storage: Handle): ComponentResult;
When your component receives a request, it should perform the action specified in the what field of the component parameters record. Your component should return a value of type ComponentResult (a long integer). If your component does not return error information as its function result, it should indicate errors using the SetComponentInstanceError procedure.
For information on the component parameters record, see The Component Parameters Record . For information on writing a component, see "Creating Components," .